/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

.searchHeader {
  display: flex;
  gap: 0.8rem;
}

.searchForm {
  position: relative;
  flex: 1;
  &:focus + svg {
    color: red;
  }
}

.searchIcon {
  position: absolute;
  top: calc(50% - 1rem);
  left: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
}

.searchQueryInput {
  padding: 0.8rem 0.8rem 0.8rem 3rem;
  width: 100%;
}

.searchVersionInput {
  padding: 0.8rem 2rem 0.8rem 0.8rem;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1em;
}

.searchQueryInput,
.searchVersionInput {
  border-radius: 1000em;
  border-style: solid;
  border-color: transparent;
  font: var(--ifm-font-size-base) var(--ifm-font-family-base);
  background-color: var(--docsearch-searchbox-background);
  color: var(--docsearch-text-color);
  margin-bottom: 0.5rem;
  transition: border var(--ifm-transition-fast) ease;

  &:focus {
    background-color: var(--ifm-background-color);

    + svg {
      color: var(--docsearch-primary-color);
    }
  }
}

.searchQueryInput:focus,
.searchVersionInput:focus {
  border-color: var(--docsearch-primary-color);
  outline: none;
}

.searchQueryInput::placeholder {
  color: var(--docsearch-muted-color);
}

.searchResultsColumn {
  text-align: left;
  font-size: 0.9rem;
  font-weight: bold;
}

.algoliaLogo {
  max-width: 150px;
}

.algoliaLogoPathFill {
  fill: var(--ifm-font-color-base);
}

.searchResultItem {
  text-align: left;
  padding: 1rem 0;
  border-bottom: 1px solid var(--ifm-toc-border-color);
}

.searchResultItemHeading {
  margin-bottom: 0;
}

.searchResultItemPath {
  font-size: 0.7rem;
  color: var(--ifm-color-content-secondary);
  --ifm-breadcrumb-separator-size-multiplier: 1;
}

.searchResultItemSummary {
  margin: 0.5rem 0 0 0;
  font-style: italic;
  font-size: 0.9rem;
}

@media only screen and (max-width: 996px) {
  .searchResultsColumn {
    max-width: 60% !important;
  }

  .searchLogoColumn {
    max-width: 40% !important;
    padding-left: 0 !important;
  }
}

@media screen and (max-width: 576px) {
  .searchQueryColumn {
    max-width: 100% !important;
  }

  .searchVersionColumn {
    max-width: 100% !important;
    padding-left: var(--ifm-spacing-horizontal) !important;
    margin: auto;
  }
}

.searchVersionColumn {
  margin: auto;
}

.loadingSpinner {
  width: 3rem;
  height: 3rem;
  border: 0.4em solid #eee;
  border-top-color: var(--ifm-color-primary);
  border-radius: 50%;
  animation: loadingspin 1s linear infinite;
  margin: 0 auto;
}

@keyframes loadingspin {
  100% {
    transform: rotate(360deg);
  }
}

.loader {
  margin-top: 2rem;
}

:global(.search-result-match) {
  color: var(--docsearch-hit-color);
  background: rgba(255, 215, 142, 0.25);
  padding: 0.09em 0;
}
